<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use app\assets\AppAsset;
use yii\widgets\ActiveForm;
use app\models\LoginForm;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>


        <div style="margin: 0px auto;width: 250px;height: 100px;font-size: 30px;text-align: center;line-height: 100px;color: black">
            分销系统后台登录
        </div>

        <div style="width: 500px;height: 450px;margin: 0 auto;background-color: lightgrey;border-radius: 10px">
            <div style="margin: 0px auto;width: 400px;height: 400px;padding-top: 50px">

                <?php $form = ActiveForm::begin([
                    'id' => 'login-form',
                    'options' => ['class' => 'form-horizontal'],
                ]); ?>

                <?= $form->field($model, 'username') ?>
                <?= $form->field($model, 'password')->passwordInput() ?>
                <?= $form->field($model, 'rememberMe')->checkbox()?>

                <div class="form-group">
                    <div class="col-lg-12">
                        <?= Html::submitButton('登录', ['class' => 'btn btn-primary btn-block']) ?>
                    </div>
                </div>
                <?php ActiveForm::end() ?>
            </div>
        </div>


<?php
if($model -> error){
    echo "<script type='text/javascript'>alert('账号或者密码错误请重新填写.');</script>";
}
?>

<?php $this->endBody() ?>
</body>

</html>
<?php $this->endPage() ?>
